package flc.ast.fragment;

import android.content.Intent;
import android.provider.Settings;
import android.view.View;

import androidx.fragment.app.Fragment;

import flc.ast.R;
import flc.ast.activity.ScreenMirroringInstActivity;
import flc.ast.databinding.FragmentHomeBinding;
import stark.common.basic.base.BaseNoModelFragment;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link HomeFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class HomeFragment extends BaseNoModelFragment<FragmentHomeBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_home;
    }

    @Override
    protected void initView() {
        mDataBinding.tvScreenMirroring.setOnClickListener(this);
        mDataBinding.ivUseInst.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        int id = v.getId();
        if (id == R.id.tvScreenMirroring) {//屏幕镜像
            // 跳转至系统投屏设置界面
            Intent intent = new Intent(Settings.ACTION_CAST_SETTINGS);
            startActivity(intent);
        } else if (id == R.id.ivUseInst) {//使用说明
            startActivity(ScreenMirroringInstActivity.class);
        }
    }

    @Override
    protected void initData() {

    }

}